- "abcdefghijklmnopqrstuvwxyz" Substitute(klm, KLM)
results: "abcdefghijKLMnopqrstuvwxyz
- 23.5g substitutes(g, gram)
results in "23.5 grams "; the object on the stack top is transformed into a string before the replace operation
- "abcdefghijklmnopqrstuvwxyz" "klm" "*" Substitute(STACK, STACK)
results: "abcdefghij*nopqrstuvwxyz"; each of the two operands can be passed by stack
- "abcdefghijklmnopqrstuvwxyz" "klm" "" Substitute(STACK, STACK)
results: "abcdefghijnopqrstuvwxyz";" klm" is replaced by the empty string, i.e. "klm" disappears
- "abcdefghijklmnopqrstuvwxyz" "" "***" Substitute(STACK, STACK)
results: "abcdefghijklmnopqrstuvwxyz"; replace "nothing" with something: the original string remains unchanged
- "fair is foul and foul is fair..." Substitutes(fair, FAIR)
results: "FAIR is foul and foul is FAIR... "; because multiple substitutions are possible